﻿//-----------------------------------------------------------------------
// <copyright file="ITaskExecutor.cs" 
//        company="MicroMan6502">
//
//    Copyright (c)2010 MicroMan6502. All rights reserved.
//
// </copyright>
//-----------------------------------------------------------------------

namespace EasyThreading
{
    /// <summary>
    /// Defeines the delegate used to perform the thread task.
    /// </summary>
    /// <param name="param">A user definable parameter.</param>
    public delegate void TaskCallback(object param);

    /// <summary>
    /// The interface used to access the task executor service.
    /// </summary>
    public interface ITaskExecutor
    {
        /// <summary>
        /// Queues a task ready for processing.
        /// </summary>
        /// <param name="task">A reference to the callback.</param>
        /// <param name="param">An optional parameter.</param>
        void QueueTask(TaskCallback task, object param);

        /// <summary>
        /// Gets the number of pending tasks.
        /// </summary>
        int PendingTaskCount { get; }
    }
}
